import 'package:backend.core/core/domain/entities/api/google_play/api_google_play_purchased_subscription_price_change_status.dart';
import 'package:backend.core/core/domain/entities/google_play/google_play_purchased_subscription_info_price_change_status.dart';

abstract class CreateApiGooglePlayPurchasedSubscriptionPriceChangeStatusFromInternalOne {
  ApiGooglePlayPurchasedSubscriptionPriceChangeStatus call({
    required GooglePlayPurchasedSubscriptionInfoPriceChangeStatus priceChangeStatus,
  });
}

class CreateApiGooglePlayPurchasedSubscriptionPriceChangeStatusFromInternalOneImpl
    implements CreateApiGooglePlayPurchasedSubscriptionPriceChangeStatusFromInternalOne {
  const CreateApiGooglePlayPurchasedSubscriptionPriceChangeStatusFromInternalOneImpl();

  @override
  ApiGooglePlayPurchasedSubscriptionPriceChangeStatus call({
    required GooglePlayPurchasedSubscriptionInfoPriceChangeStatus priceChangeStatus,
  }) {
    switch (priceChangeStatus) {
      case GooglePlayPurchasedSubscriptionInfoPriceChangeStatus.absent:
        return ApiGooglePlayPurchasedSubscriptionPriceChangeStatus.absent;
      case GooglePlayPurchasedSubscriptionInfoPriceChangeStatus.accepted:
        return ApiGooglePlayPurchasedSubscriptionPriceChangeStatus.accepted;
      case GooglePlayPurchasedSubscriptionInfoPriceChangeStatus.pending:
        return ApiGooglePlayPurchasedSubscriptionPriceChangeStatus.pending;
    }
  }
}
